<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class AdminRoleCheck
{
    public function handle($request, Closure $next)
    {
        if(Auth::User()->level<10){
            return redirect('/admin');
        }

        return $next($request);
    }
}
